package com.example.demo.questions.entity;

import java.math.BigDecimal;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;

import java.io.Serializable;
import java.util.List;

import com.example.demo.answers.entity.TAnswers;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Transient;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;

/**
 * <p>
 * 考题表
 * </p>
 *
 * @author zhongz
 * @since 2019-02-16
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class TQuestions implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @TableId("ID")
    private String id;

    /**
     * 考题内容
     */
    @TableField("QUES_CONTENT")
    @NotEmpty(message = "考题内容不能为空")
    @Email(message = "请输入正确的Email格式")
    private String quesContent;

    /**
     * 答案总数
     */
    @TableField("ANSWER_TOTAL_COUNT")
    private Integer answerTotalCount;

    /**
     * 正确答案ID
     */
    @TableField("RIGHT_ANSWER_ID")
    private String rightAnswerId;

    /**
     * 解析
     */
    @TableField("ANALYSIS")
    private String analysis;

    /**
     * 答案列表
     */
    @TableField(exist = false)
    private List<TAnswers> answers;

    /**
     * _id
     * 做为导入小程序云数据库的唯一标识
     */
    @TableField(exist = false)
    private String _id;

    public void setId(String id) {
        this.id = id;
        this._id = id;
    }
}
